package framework.core.util;

import java.util.Comparator;

import org.apache.log4j.Logger;

import framework.system.entity.SysResource;

/**
 * @ClassName: MenuComparator 
 * @Description: 菜单排序
 * @author: Ching Wang
 * @date 2013-5-18 下午1:05:27 
 *
 */
public class MenuComparator implements Comparator<SysResource> {

	private static final Logger logger = Logger.getLogger(MenuComparator.class);

	public int compare(SysResource o1, SysResource o2) {
		int i1 = o1.getSeq() != null ? o1.getSeq().intValue() : -1;
		int i2 = o2.getSeq() != null ? o2.getSeq().intValue() : -1;
		logger.debug("i1[" + i1 + "]-i2[" + i2 + "]=" + (i1 - i2));
		return i1 - i2;
	}

}
